import { axios as request } from '@/utils/request'

const goodsDetailVisitAPI = {
  visit: '/analytics/hTGoodsDetailVisitAction/add',
  leave: '/analytics/hTGoodsDetailVisitAction/visitEdit',
  updateImmediatelyPurchaseClickCount: '/analytics/hTGoodsDetailVisitAction/updateImmediatelyPurchaseClickCount',
  updateAddToCartClickCount: '/analytics/hTGoodsDetailVisitAction/updateAddToCartClickCount',
}

export function visitGoodsDetailRequest(parameters) {
  return request({
    url: goodsDetailVisitAPI.visit,
    method: 'post',
    data: parameters,
  })
}

export function leaveGoodsDetailRequest(parameters) {
  return request({
    url: goodsDetailVisitAPI.leave,
    method: 'post',
    data: parameters,
  })
}

export function updateAddToCartClickCountRequest(parameters) {
  return request({
    url: goodsDetailVisitAPI.updateAddToCartClickCount,
    method: 'post',
    data: parameters,
  })
}

export function updateImmediatelyPurchaseClickCountRequest(parameters) {
  return request({
    url: goodsDetailVisitAPI.updateImmediatelyPurchaseClickCount,
    method: 'post',
    data: parameters,
  })
}

